import request from '@/utils/request'

export function listCompetition(query) {
  return request({
    url: '/race/competition/list',
    method: 'get',
    params: query
  })
}

export function getCompetition(id) {
  return request({
    url: `/race/competition/${id}`,
    method: 'get'
  })
}

export function addCompetition(data) {
  return request({
    url: '/race/competition',
    method: 'post',
    data
  })
}

export function updateCompetition(data) {
  return request({
    url: '/race/competition',
    method: 'put',
    data
  })
}

export function delCompetition(ids) {
  return request({
    url: `/race/competition/${ids}`,
    method: 'delete'
  })
}
